/**
 * Project Name:mms
 * File Name:RemoteServiceImpl
 * Package Name:com.scb.dev.mms.service.impl
 * Date:2018/12/422:50
 * Copyright (c) 2018, Yuchuan.Dong All Rights Reserved.
 */
package com.scb.dev.mms.service.impl;

import com.scb.dev.mms.common.ResponseResult;
import com.scb.dev.mms.dao.AccountMapper;
import com.scb.dev.mms.dao.EmployeeMapper;
import com.scb.dev.mms.dto.BookMeetingDto;
import com.scb.dev.mms.dto.InsertMeetingDto;
import com.scb.dev.mms.feign.MeetingFeign;
import com.scb.dev.mms.pojo.Employee;
import com.scb.dev.mms.service.IRemoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.xml.ws.ServiceMode;

/**
 * ClassName: RemoteServiceImpl <br/>
 * @Description: ${todo} ADD REASON(可选). <br/><br/>
 * @Date: 2018/12/4 22:50 <br/> 
 *
 * @author Yuchuan.Dong
 * @version V1.0
 * @since JDK 1.8
 */
@Service
public class RemoteServiceImpl implements IRemoteService {
    @Resource
    private AccountMapper accountMapper;

    @Autowired
    private MeetingFeign meetingFeign;

    @Override
    public ResponseResult queryCustomBookMeetingInfo(String accountId) {
        String creatorName = accountMapper.selectAccountNameByPrimaryKey(accountId);
        return meetingFeign.queryCustomBookMeetingInfo(creatorName);
    }

    @Override
    public ResponseResult queryAllMeetingRoom() {
        return meetingFeign.queryAllMeetingRoom();
    }

    @Override
    public ResponseResult queryAvailableMeetingRoomTime(BookMeetingDto bookMeetingDto) {
        return meetingFeign.queryAvailableMeetingRoomInfo(bookMeetingDto);
    }

    @Override
    public ResponseResult insertMeetingInfo(InsertMeetingDto insertMeetingDto, String operationId) {
        String creatorName = accountMapper.selectAccountNameByPrimaryKey(operationId);
        insertMeetingDto.setCreateName(creatorName);
        return meetingFeign.bookMeeting(insertMeetingDto);
    }


}
